<header>
    <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
        <a class="navbar-brand" href="/">{{ sitename }}</a>
        <div class="collapse navbar-collapse" id="navbarCollapse">
            <ul class="navbar-nav mr-auto">
                {% for item in menu %}
                <li class="nav-item active">
                    <a class="nav-link" href="{{item.link}}">{{item.text}}</a>
                </li>
                {% endfor %}
            </ul>
            <ul class="navbar-nav mr-1">
                <li class="nav-item">
                {% if request.user.is_authenticated %}
                    <a class="nav-link active" href="{% url 'logout' %}">Выйти</a>
                {% else %}
                    <a class="nav-link active" href="{% url 'login' %}">Войти</a>
                {% endif %}
                </li>
            </ul>
        </div>
    </nav>
</header>